﻿using MiniFox.Infrastructure.Attributes;
using Newtonsoft.Json;

namespace MiniFox.Platform.Applications.Models
{
    /// <summary>
    /// 导航基类（menu / ribbon）
    /// </summary>
    [TreeNode("ID", "SuperID", "Ordinal", "ApplicationID")]
    public abstract class SystemNavBase
    {
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("id")]
        public string ID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore]
        public string SuperID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("label")]
        public string Label { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("icon")]
        public string Icon { get; set; }
        /// <summary>
        /// 排序值
        /// </summary>
        [JsonProperty("ordinal")]
        public int Ordinal { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("navType")]
        abstract public NavType NavType { get; }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore]
        public string ApplicationID { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public enum NavType : byte
    {
        /// <summary>
        /// 
        /// </summary>
        Group = 8,
        /// <summary>
        /// 
        /// </summary>
        Module = 2,
        /// <summary>
        /// 
        /// </summary>
        Action = 0,
        /// <summary>
        /// 
        /// </summary>
        Link = 1
    }


    /// <summary>
    /// 
    /// </summary>
    public enum OpenMode : byte
    {
        /// <summary>
        /// 
        /// </summary>
        NewTab = 0,
        /// <summary>
        /// 
        /// </summary>
        NewWindow = 1,
        /// <summary>
        /// 
        /// </summary>
        Dialog = 2
    }
}
